Version

MeetsCriteria(ColumnFilter[],FilterLogicalOperator) Method

Returns true if the row meets the criteria specified by the passed in column filters and the logical operator. If the logical operator is And and the row meets all the conditions in the column filters array then this method returns true. If the logical operator is Or and the row meets at least one of the column filter then this method returns true. Otherwise it returns false.
Syntax
'Declaration
 
Public Overloads Function MeetsCriteria( _
   ByVal columnFilters() As ColumnFilter, _
   ByVal logicalOperator As FilterLogicalOperator _
) As Boolean
public bool MeetsCriteria( 
   ColumnFilter[] columnFilters,
   FilterLogicalOperator logicalOperator
)

Parameters

columnFilters
Filter conditions.
logicalOperator
Logical operator to combine column filters in the column filters array.

Return Value

true if the row meets the criteria of the FilterCondition, false if it does not.
Remarks

Returns true if the row meets the criteria specified by the passed in column filters and the logical operator. If the logical operator is And and the row meets all the conditions in the column filters array then this method returns true. If the logical operator is Or and the row meets at least one of the column filter then this method returns true. Otherwise it returns false.

Example
Following sample code shows a typical usage for MeetsCriteria method. It will filter out rows so that only the rows whose CustomerID field begins with either the letter 'A' or the letter 'B' will be displayed. It uses the overload of MeetsCriteria that takes in a ColumnFilter object. A ColumnFilter object can contian multiple filter conditions that are Or'ed or And'ed depending on the value of the filterLogicalOperator parameter (the second parameter) to the constructor.

Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid


    Private Sub UltraGrid1_InitializeLayout(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles UltraGrid1.InitializeLayout
        ' Call RefreshFilters to cause the UltraGrid to reevaluate any filters and fire
        ' FilterRow event on every row.
        '
        e.Layout.RefreshFilters()
    End Sub

    Private Sub UltraGrid1_FilterRow(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.FilterRowEventArgs) Handles UltraGrid1.FilterRow
        Dim band As UltraGridBand = e.Row.Band
        If "Customers" = band.Key Then
            ' Construct a ColumnFilter object. Note that we are specifying logical operator of "OR" as 
            ' the second parameter to the constructor. That's because we want to show rows that begin
            ' with 'A' OR 'B'.
            '
            Dim cf As ColumnFilter = New ColumnFilter(band.Columns("CustomerID"), FilterLogicalOperator.Or)
            cf.FilterConditions.Add(FilterComparisionOperator.Like, "A*")
            cf.FilterConditions.Add(FilterComparisionOperator.Like, "B*")

            ' Call MeetsCriteria off the row to test if the row passes the column filter.
            '
            If Not e.Row.MeetsCriteria(cf) Then
                e.RowFilteredOut = True
            Else
                e.RowFilteredOut = False
            End If
        End If
    End Sub
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;


		private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
		{
			// Call RefreshFilters to cause the UltraGrid to reevaluate any filters and fire
			// FilterRow event on every row.
			//
			e.Layout.RefreshFilters( );
		}

		private void ultraGrid1_FilterRow(object sender, Infragistics.Win.UltraWinGrid.FilterRowEventArgs e)
		{
			UltraGridBand band = e.Row.Band;
			if ( "Customers" == band.Key )
			{
				// Construct a ColumnFilter object. Note that we are specifying logical operator of "OR" as 
				// the second parameter to the constructor. That's because we want to show rows that begin
				// with 'A' OR 'B'.
				//
				ColumnFilter cf = new ColumnFilter( band.Columns[ "CustomerID" ], FilterLogicalOperator.Or );
				cf.FilterConditions.Add( FilterComparisionOperator.Like, "A*" );
				cf.FilterConditions.Add( FilterComparisionOperator.Like, "B*" );

				// Call MeetsCriteria off the row to test if the row passes the column filter.
				//
				if ( ! e.Row.MeetsCriteria( cf ) )
					e.RowFilteredOut = true;
				else
					e.RowFilteredOut = false;
			}
		}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also